<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改角色权限</title>
</head>
<style type="text/css">
	th{font-size:20px;padding:20px;}
	td{text-align:right;line-height:2em;}
	form{width:35%;margin:auto;}
</style>
<%
	String path = request.getContextPath();
	request.setAttribute("path", request.getContextPath());
	request.setAttribute("jsPath", path+"/js");
%>
<script type="text/javascript" src="${jsPath}/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	$(function(){
		var msg = $("#msg").html();
		if(msg != null){
			alert(msg);
		}
	});
</script>
<body>
	<c:if test="${not empty msg}"><p style="display:none" id="msg">${msg}</p></c:if>
	<form action="${path}/roleAuthority/update" method="post">
		<input type="hidden" name="roleAuthorityId" value="${roleAuthority.roleAuthorityId}"/>
		<input type="hidden" name="roleId" value="${roleAuthority.roleId}"/>
		<table>
			<tr>
				<th colspan="2">修改角色权限</th>
			</tr>
			<tr>
				<td>角色权限ID：</td>
				<td><input type="text" disabled="disabled" value="${roleAuthority.roleAuthorityId}"/></td>
			</tr>
			<tr>
				<td>角色名称：</td>
				<td><input type="text" disabled="disabled" value="${roleAuthority.roleName}"/></td>
			</tr>
			<tr>
				<td>权限名称：</td>
				<td style="text-align:left;">
					<select name="functionAuthorityId">
						<c:forEach var="functionAuthority" items="${functionAuthorityList}">
							<c:if test="${roleAuthority.authorityName != functionAuthority.name}">
								<option value="${functionAuthority.functionAuthorityId}">${functionAuthority.name}</option>
							</c:if>
							<c:if test="${roleAuthority.authorityName == functionAuthority.name}">
								<option selected="selected" value="${functionAuthority.functionAuthorityId}">${functionAuthority.name}</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td style="text-align:left;">
					<input type="reset" value="重置"/>
					<input type="submit" value="修改"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>